home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / patch / Configure < prev    next >
Text File  |  1994-08-01  |  33KB  |  1,472 lines

  1. #! /bin/sh
  2. #
  3. # If these # comments don't work, trim them.  Don't worry about any other
  4. # shell scripts, Configure will trim # comments from them for you.
  5. #
  6. # (If you are trying to port this package to a machine without sh, I would
  7. # suggest you cut out the prototypical config.h from the end of Configure
  8. # and edit it to reflect your system.  Some packages may include samples
  9. # of config.h for certain machines, so you might look for one of those.)
  10. #
  11. # $Header: Head.U,v 1.0 87/05/22 12:28:10 lwall Exp $
  12. #
  13. # Yes, you may rip this off to use in other distribution packages.
  14. # (Note: this Configure script was generated automatically.  Rather than
  15. # working with this copy of Configure, you may wish to get metaconfig.)
  16.  
  17. : sanity checks
  18. PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin'
  19. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  20.  
  21. if test ! -t 0; then
  22.     echo "Say 'sh Configure', not 'sh <Configure'"
  23.     exit 1
  24. fi
  25.  
  26. (alias) >/dev/null 2>&1 && \
  27.     echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
  28.     echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
  29.  
  30. if test ! -d ../UU; then
  31.     if test ! -d UU; then
  32.     mkdir UU
  33.     fi
  34.     cd UU
  35. fi
  36.  
  37. case "$1" in
  38. -d) shift; fastread='yes';;
  39. esac
  40.  
  41. d_eunice=''
  42. eunicefix=''
  43. define=''
  44. loclist=''
  45. expr=''
  46. sed=''
  47. echo=''
  48. cat=''
  49. rm=''
  50. mv=''
  51. cp=''
  52. tail=''
  53. tr=''
  54. mkdir=''
  55. sort=''
  56. uniq=''
  57. grep=''
  58. trylist=''
  59. test=''
  60. inews=''
  61. egrep=''
  62. more=''
  63. pg=''
  64. Mcc=''
  65. vi=''
  66. mailx=''
  67. mail=''
  68. cpp=''
  69. Log=''
  70. Header=''
  71. bin=''
  72. cc=''
  73. contains=''
  74. cppstdin=''
  75. cppminus=''
  76. d_charsprf=''
  77. d_flexfnam=''
  78. d_index=''
  79. d_voidsig=''
  80. d_dirheader=''
  81. d_unistd=''
  82. libc=''
  83. mansrc=''
  84. manext=''
  85. models=''
  86. split=''
  87. small=''
  88. medium=''
  89. large=''
  90. huge=''
  91. ccflags=''
  92. ldflags=''
  93. n=''
  94. c=''
  95. package=''
  96. registers=''
  97. reg1=''
  98. reg2=''
  99. reg3=''
  100. reg4=''
  101. reg5=''
  102. reg6=''
  103. reg7=''
  104. reg8=''
  105. reg9=''
  106. reg10=''
  107. reg11=''
  108. reg12=''
  109. reg13=''
  110. reg14=''
  111. reg15=''
  112. reg16=''
  113. spitshell=''
  114. shsharp=''
  115. sharpbang=''
  116. startsh=''
  117. voidflags=''
  118. defvoidused=''
  119. CONFIG=''
  120. : set package name
  121. package=patch
  122.  
  123. echo " "
  124. echo "Beginning of configuration questions for $package kit."
  125. : Eunice requires " " instead of "", can you believe it
  126. echo " "
  127.  
  128. define='define'
  129. undef='/*undef'
  130. libpth='/usr/lib /usr/local/lib /lib /usr/ccs/lib'
  131. smallmach='pdp11 i8086 z8000 i80286 iAPX286'
  132. rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
  133. trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  134.  
  135. : We must find out about Eunice early
  136. eunicefix=':'
  137. if test -f /etc/unixtovms; then
  138.     eunicefix=/etc/unixtovms
  139. fi
  140. if test -f /etc/unixtovms.exe; then
  141.     eunicefix=/etc/unixtovms.exe
  142. fi
  143.  
  144. attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  145. attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
  146. attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  147. attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  148. attrlist="$attrlist mc68k m68k __STDC__"
  149. pth="/bin /usr/bin /usr/ccs/bin /usr/ucb /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /lib"
  150. d_newshome="../../NeWS"
  151. defvoidused=7
  152.  
  153. : some greps do not return status, grrr.
  154. echo "grimblepritz" >grimble
  155. if grep blurfldyick grimble >/dev/null 2>&1 ; then
  156.     contains=contains
  157. elif grep grimblepritz grimble >/dev/null 2>&1 ; then
  158.     contains=grep
  159. else
  160.     contains=contains
  161. fi
  162. rm -f grimble
  163. : the following should work in any shell
  164. case "$contains" in
  165. contains*)
  166.     echo " "
  167.     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  168.     cat >contains <<'EOSS'
  169. grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  170. EOSS
  171. chmod +x contains
  172. esac
  173.  
  174. : first determine how to suppress newline on echo command
  175. echo "Checking echo to see how to suppress newlines..."
  176. (echo "hi there\c" ; echo " ") >.echotmp
  177. if $contains c .echotmp >/dev/null 2>&1 ; then
  178.     echo "...using -n."
  179.     n='-n'
  180.     c=''
  181. else
  182.     cat <<'EOM'
  183. ...using \c
  184. EOM
  185.     n=''
  186.     c='\c'
  187. fi
  188. echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
  189. read ans
  190. rm -f .echotmp
  191.  
  192. : now set up to do reads with possible shell escape and default assignment
  193. cat <<EOSC >myread
  194. case "\$fastread" in
  195. yes) ans=''; echo " " ;;
  196. *) ans='!';;
  197. esac
  198. while expr "X\$ans" : "X!" >/dev/null; do
  199.     read ans
  200.     case "\$ans" in
  201.     !)
  202.     sh
  203.     echo " "
  204.     echo $n "\$rp $c"
  205.     ;;
  206.     !*)
  207.     set \`expr "X\$ans" : "X!\(.*\)\$"\`
  208.     sh -c "\$*"
  209.     echo " "
  210.     echo $n "\$rp $c"
  211.     ;;
  212.     esac
  213. done
  214. rp='Your answer:'
  215. case "\$ans" in
  216. '') ans="\$dflt";;
  217. esac
  218. EOSC
  219.  
  220. : general instructions
  221. cat <<EOH
  222.  
  223. This installation shell script will examine your system and ask you questions
  224. to determine how the $package package should be installed.  If you get stuck
  225. on a question, you may use a ! shell escape to start a subshell or execute
  226. a command.  Many of the questions will have default answers in square
  227. brackets--typing carriage return will give you the default.
  228.  
  229. On some of the questions which ask for file or directory names you are
  230. allowed to use the ~name construct to specify the login directory belonging
  231. to "name", even if you don't have a shell which knows about that.  Questions
  232. where this is allowed will be marked "(~name ok)".
  233.  
  234. EOH
  235. rp="[Type carriage return to continue]"
  236. echo $n "$rp $c"
  237. . myread
  238. cat <<EOH
  239.  
  240. Much effort has been expended to ensure that this shell script will run
  241. on any Unix system.  If despite that it blows up on you, your best bet is
  242. to edit Configure and run it again. Also, let me (lwall@netlabs.com)
  243. know how I blew it.  If you can't run Configure for some reason, you'll have
  244. to generate a config.sh file by hand.
  245.  
  246. This installation script affects things in two ways: 1) it may do direct
  247. variable substitutions on some of the files included in this kit, and
  248. 2) it builds a config.h file for inclusion in C programs.  You may edit
  249. any of these files as the need arises after running this script.
  250.  
  251. If you make a mistake on a question, there is no easy way to back up to it
  252. currently.  The easiest thing to do is to edit config.sh and rerun all the
  253. SH files.  Configure will offer to let you do this before it runs the SH files.
  254.  
  255. EOH
  256. rp="[Type carriage return to continue]"
  257. echo $n "$rp $c"
  258. . myread
  259.  
  260. : get old answers, if there is a config file out there
  261. if test -f ../config.sh; then
  262.     echo " "
  263.     dflt=y
  264.     rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
  265.     echo $n "$rp $c"
  266.     . myread
  267.     case "$ans" in
  268.     n*) echo "OK, I'll ignore it.";;
  269.     *)  echo "Fetching default answers from your old config.sh file..."
  270.     tmp="$n"
  271.     ans="$c"
  272.         . ../config.sh
  273.     n="$tmp"
  274.     c="$ans"
  275.     ;;
  276.     esac
  277. fi
  278.  
  279. : find out where common programs are
  280. echo " "
  281. echo "Locating common programs..."
  282. cat <<EOSC >loc
  283. $startsh
  284. case \$# in
  285. 0) exit 1;;
  286. esac
  287. thing=\$1
  288. shift
  289. dflt=\$1
  290. shift
  291. for dir in \$*; do
  292.     case "\$thing" in
  293.     .)
  294.     if test -d \$dir/\$thing; then
  295.         echo \$dir
  296.         exit 0
  297.     fi
  298.     ;;
  299.     *)
  300.     if test -f \$dir/\$thing; then
  301.         echo \$dir/\$thing
  302.         exit 0
  303.     elif test -f \$dir/\$thing.exe; then
  304.         : on Eunice apparently
  305.         echo \$dir/\$thing
  306.         exit 0
  307.     fi
  308.     ;;
  309.     esac
  310. done
  311. echo \$dflt
  312. exit 1
  313. EOSC
  314. chmod +x loc
  315. $eunicefix loc
  316. loclist="
  317. expr
  318. sed
  319. echo
  320. cat
  321. rm
  322. tr
  323. grep
  324. "
  325. trylist="
  326. test
  327. Mcc
  328. cpp
  329. "
  330. for file in $loclist; do
  331.     xxx=`loc $file $file $pth`
  332.     eval $file=$xxx
  333.     eval _$file=$xxx
  334.     case "$xxx" in
  335.     /*)
  336.     echo $file is in $xxx.
  337.     ;;
  338.     *)
  339.     echo "I don't know where $file is.  I hope it's in everyone's PATH."
  340.     ;;
  341.     esac
  342. done
  343. echo " "
  344. echo "Don't worry if any of the following aren't found..."
  345. ans=offhand
  346. for file in $trylist; do
  347.     xxx=`loc $file $file $pth`
  348.     eval $file=$xxx
  349.     eval _$file=$xxx
  350.     case "$xxx" in
  351.     /*)
  352.     echo $file is in $xxx.
  353.     ;;
  354.     *)
  355.     echo "I don't see $file out there, $ans."
  356.     ans=either
  357.     ;;
  358.     esac
  359. done
  360. case "$egrep" in
  361. egrep)
  362.     echo "Substituting grep for egrep."
  363.     egrep=$grep
  364.     ;;
  365. esac
  366. case "$test" in
  367. test)
  368.     echo "Hopefully test is built into your sh."
  369.     ;;
  370. /bin/test)
  371.     echo " "
  372.     dflt=n
  373.     rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)"
  374.     echo $n "$rp $c"
  375.     . myread
  376.     case "$ans" in
  377.     y*) test=test ;;
  378.     esac
  379.     ;;
  380. *)
  381.     test=test
  382.     ;;
  383. esac
  384. case "$echo" in
  385. echo)
  386.     echo "Hopefully echo is built into your sh."
  387.     ;;
  388. /bin/echo)
  389.     echo " "
  390.     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  391.     $echo $n "hi there$c" >foo1
  392.     echo $n "hi there$c" >foo2
  393.     if cmp foo1 foo2 >/dev/null 2>&1; then
  394.     echo "They are compatible.  In fact, they may be identical."
  395.     else
  396.     case "$n" in
  397.     '-n') n='' c='\c' ans='\c' ;;
  398.     *) n='-n' c='' ans='-n' ;;
  399.     esac
  400.     cat <<FOO
  401. They are not compatible!  You are probably running ksh on a non-USG system.
  402. I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
  403. have echo built in and we may have to run some Bourne shell scripts.  That
  404. means I'll have to use $ans to suppress newlines now.  Life is ridiculous.
  405.  
  406. FOO
  407.     rp="Your cursor should be here-->"
  408.     $echo $n "$rp$c"
  409.     . myread
  410.     fi
  411.     $rm -f foo1 foo2
  412.     ;;
  413. *)
  414.     : cross your fingers
  415.     echo=echo
  416.     ;;
  417. esac
  418. rmlist="$rmlist loc"
  419.  
  420. : get list of predefined functions in a handy place
  421. echo " "
  422. if test -f /lib/libc.a; then
  423.     echo "Your C library is in /lib/libc.a.  You're normal."
  424.     libc=/lib/libc.a
  425. else
  426.     if test -f /lib/clib -a -f /lib/libc; then
  427.     echo "Your standard C library is in /lib/libc.  Must be Domain/OS."
  428.     libc=/lib/libc
  429.     elif test -f /lib/libsys_s.a; then
  430.     echo "Your C library is in /lib/libsys_s.a.  Must be a NeXT."
  431.     libc=/lib/libsys_s.a
  432.     else
  433.         ans=`loc libc.a blurfl/dyick $libpth`
  434.         if test ! -f $ans; then
  435.         ans=`loc clib blurfl/dyick $libpth`
  436.         fi
  437.         if test ! -f $ans; then
  438.          ans=`loc libc blurfl/dyick $libpth`
  439.         fi
  440.         if test -f $ans; then
  441.         echo "Your C library is in $ans, of all places."
  442.         libc=$ans
  443.         else
  444.         if test -f "$libc"; then
  445.             echo "Your C library is in $libc, like you said before."
  446.         else
  447.             cat <<EOM
  448.  
  449. I can't seem to find your C library.  I've looked in the following places:
  450.  
  451.     $libpth
  452.  
  453. None of these seems to contain your C library.  What is the full name
  454. EOM
  455.             dflt=None
  456.             $echo $n "of your C library? $c"
  457.             rp='C library full name?'
  458.             . myread
  459.             libc="$ans"
  460.         fi
  461.         fi
  462.     fi
  463. fi
  464. echo " "
  465. $echo $n "Extracting names from $libc for later perusal...$c"
  466. nm $libc 2>/dev/null | sed -n -e 's/^.* T _//p' -e 's/^.* T //p' > libc.list
  467. if $contains '^printf$' libc.list >/dev/null 2>&1; then
  468.     echo "done"
  469. else
  470.     nm $libc 2>/dev/null | sed -n -e 's/^.* D _//p' -e 's/^.* D //p' > libc.list
  471.     if $contains '^printf$' libc.list >/dev/null 2>&1; then
  472.     echo "done"
  473.     else
  474.     echo " "
  475.     echo "nm didn't seem to work right."
  476.     echo "Trying ar instead..."
  477.     if ar t $libc | sed -e 's/\.o$//' > libc.list; then
  478.         echo "Ok."
  479.     else
  480.         echo "That didn't work either.  Giving up."
  481.         exit 1
  482.     fi
  483.     fi
  484. fi
  485. rmlist="$rmlist libc.list"
  486.  
  487. : make some quick guesses about what we are up against
  488. echo " "
  489. $echo $n "Hmm...  $c"
  490. if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
  491.     echo "Looks kind of like a BSD system, but we'll see..."
  492.     echo exit 0 >bsd
  493.     echo exit 1 >usg
  494.     echo exit 1 >v7
  495. elif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
  496.     echo "Looks kind of like a USG system, but we'll see..."
  497.     echo exit 1 >bsd
  498.     echo exit 0 >usg
  499.     echo exit 1 >v7
  500. else
  501.     echo "Looks kind of like a version 7 system, but we'll see..."
  502.     echo exit 1 >bsd
  503.     echo exit 1 >usg
  504.     echo exit 0 >v7
  505. fi
  506. if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
  507.     cat <<'EOI'
  508. There is, however, a strange, musty smell in the air that reminds me of
  509. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  510. EOI
  511.     echo "exit 0" >eunice
  512.     eunicefix=unixtovms
  513.     d_eunice="$define"
  514. : it so happens the Eunice I know will not run shell scripts in Unix format
  515. else
  516.     echo " "
  517.     echo "Congratulations.  You aren't running Eunice."
  518.     eunicefix=':'
  519.     d_eunice="$undef"
  520.     echo "exit 1" >eunice
  521. fi
  522. if test -f /xenix; then
  523.     echo "Actually, this looks more like a XENIX system..."
  524.     echo "exit 0" >xenix
  525. else
  526.     echo " "
  527.     echo "It's not Xenix..."
  528.     echo "exit 1" >xenix
  529. fi
  530. chmod +x xenix
  531. $eunicefix xenix
  532. if test -f /venix; then
  533.     echo "Actually, this looks more like a VENIX system..."
  534.     echo "exit 0" >venix
  535. else
  536.     echo " "
  537.     if xenix; then
  538.     : null
  539.     else
  540.     echo "Nor is it Venix..."
  541.     fi
  542.     echo "exit 1" >venix
  543. fi
  544. chmod +x bsd usg v7 eunice venix
  545. $eunicefix bsd usg v7 eunice venix
  546. rmlist="$rmlist bsd usg v7 eunice venix xenix"
  547.  
  548. : see if sh knows # comments
  549. echo " "
  550. echo "Checking your sh to see if it knows about # comments..."
  551. if sh -c '#' >/dev/null 2>&1 ; then
  552.     echo "Your sh handles # comments correctly."
  553.     shsharp=true
  554.     spitshell=cat
  555.     echo " "
  556.     echo "Okay, let's see if #! works on this system..."
  557.     echo "#!/bin/echo hi" > try
  558.     $eunicefix try
  559.     chmod +x try
  560.     try > today
  561.     if $contains hi today >/dev/null 2>&1; then
  562.     echo "It does."
  563.     sharpbang='#!'
  564.     else
  565.     echo "#! /bin/echo hi" > try
  566.     $eunicefix try
  567.     chmod +x try
  568.     try > today
  569.     if test -s today; then
  570.         echo "It does."
  571.         sharpbang='#! '
  572.     else
  573.         echo "It doesn't."
  574.         sharpbang=': use '
  575.     fi
  576.     fi
  577. else
  578.     echo "Your sh doesn't grok # comments--I will strip them later on."
  579.     shsharp=false
  580.     echo "exec grep -v '^#'" >spitshell
  581.     chmod +x spitshell
  582.     $eunicefix spitshell
  583.     spitshell=`pwd`/spitshell
  584.     echo "I presume that if # doesn't work, #! won't work either!"
  585.     sharpbang=': use '
  586. fi
  587.  
  588. : figure out how to guarantee sh startup
  589. echo " "
  590. echo "Checking out how to guarantee sh startup..."
  591. startsh=$sharpbang'/bin/sh'
  592. echo "Let's see if '$startsh' works..."
  593. cat >try <<EOSS
  594. $startsh
  595. set abc
  596. test "$?abc" != 1
  597. EOSS
  598.  
  599. chmod +x try
  600. $eunicefix try
  601. if try; then
  602.     echo "Yup, it does."
  603. else
  604.     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  605. fi
  606. rm -f try today
  607.  
  608. #: see if sprintf is declared as int or pointer to char
  609. #echo " "
  610. #cat >.ucbsprf.c <<'EOF'
  611. #main() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); }
  612. #EOF
  613. #if cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
  614. #    echo "Your sprintf() returns (int)."
  615. #    d_charsprf="$undef"
  616. #else
  617. #    echo "Your sprintf() returns (char*)."
  618. #    d_charsprf="$define"
  619. #fi
  620. #/bin/rm -f .ucbsprf.c .ucbsprf
  621.  
  622. : see if we can have long filenames
  623. echo " "
  624. rm -f 123456789abcde
  625. if (echo hi >123456789abcdef) 2>/dev/null; then
  626.     : not version 8
  627.     if test -f 123456789abcde; then
  628.     echo 'You cannot have filenames longer than 14 characters.  Sigh.'
  629.     d_flexfnam="$undef"
  630.     else
  631.     echo 'You can have filenames longer than 14 characters.'
  632.     d_flexfnam="$define"
  633.     fi
  634. else
  635.     : version 8 probably
  636.     echo "You can't have filenames longer than 14 chars.  V8 can't even think about them!"
  637.     d_flexfnam="$undef"
  638. fi 
  639. : index or strcpy
  640. echo " "
  641. case "$d_index" in
  642. n) dflt=n;;
  643. *) dflt=y;;
  644. esac
  645. if $contains '^index$' libc.list >/dev/null 2>&1 ; then
  646.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  647.     echo "Your system has both index() and strchr().  Shall I use"
  648.     rp="index() rather than strchr()? [$dflt]"
  649.     $echo $n "$rp $c"
  650.     . myread
  651.     case "$ans" in
  652.         n*) d_index="$define" ;;
  653.         *)  d_index="$undef" ;;
  654.     esac
  655.     else
  656.     d_index="$undef"
  657.     echo "index() found."
  658.     fi
  659. else
  660.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  661.     d_index="$define"
  662.     echo "strchr() found."
  663.     else
  664.     echo "No index() or strchr() found!"
  665.     d_index="$undef"
  666.     fi
  667. fi
  668.  
  669. : see if signal is declared as pointer to function returning int or void
  670. echo " "
  671. if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ||
  672. $contains 'void.*signal' /usr/include/sys/signal.h >/dev/null 2>&1 ; then
  673.     echo "You have void (*signal())() instead of int."
  674.     d_voidsig="$define"
  675. else
  676.     echo "You have int (*signal())() instead of void."
  677.     d_voidsig="$undef"
  678. fi
  679.  
  680. : check for directory library
  681. echo " "
  682. if test -f /usr/include/dirent.h; then
  683.     echo "You have dirent.h."
  684.     d_dirheader="#define DIRENT"
  685. elif test -f /usr/include/ndir.h; then
  686.     echo "You have ndir.h."
  687.     d_dirheader="#define USG"
  688. elif test -f /usr/include/sys/ndir.h; then
  689.     echo "You have sys/ndir.h."
  690.     d_dirheader="#define SYSNDIR
  691. #define USG"
  692. elif test -f /usr/include/sys/dir.h; then
  693.     echo "You have sys/dir.h; I hope that's the BSD version."
  694.     d_dirheader="#define SYSDIR"
  695. else
  696.     echo "I can't find a directory library header file.
  697. That means you won't have numbered backups available."
  698.     d_dirheader="#define NODIR"
  699. fi
  700.  
  701. : check for unistd.h
  702. echo " "
  703. if test -f /usr/include/unistd.h; then
  704.     echo "You have unistd.h."
  705.     d_unistd="$define"
  706. else
  707.     echo "I don't see unistd.h, but that's OK."
  708.     d_unistd="$undef"
  709. fi
  710.  
  711. : check for void type
  712. echo " "
  713. $cat <<EOM
  714. Checking to see how well your C compiler groks the void type...
  715.  
  716.   Support flag bits are:
  717.     1: basic void declarations.
  718.     2: arrays of pointers to functions returning void.
  719.     4: operations between pointers to and addresses of void functions.
  720.  
  721. EOM
  722. case "$voidflags" in
  723. '')
  724.     $cat >try.c <<'EOCP'
  725. #if TRY & 1
  726. void main() {
  727. #else
  728. main() {
  729. #endif
  730.     extern void *moo();
  731.     void *(*goo)();
  732. #if TRY & 2
  733.     void (*foo[10])();
  734. #endif
  735.  
  736. #if TRY & 4
  737.     if(*goo == moo) {
  738.         exit(0);
  739.     }
  740. #endif
  741.     exit(0);
  742. }
  743. EOCP
  744.     if cc -S -DTRY=7 try.c >.out 2>&1 ; then
  745.     voidflags=7
  746.     echo "It appears to support void fully."
  747.     if $contains warning .out >/dev/null 2>&1; then
  748.         echo "However, you might get some warnings that look like this:"
  749.         $cat .out
  750.     fi
  751.     else
  752.     echo "Hmm, you compiler has some difficulty with void.  Checking further..."
  753.     if cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then
  754.         echo "It supports 1..."
  755.         if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
  756.         voidflags=3
  757.         echo "And it supports 2 but not 4."
  758.         else
  759.         echo "It doesn't support 2..."
  760.         if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
  761.             voidflags=5
  762.             echo "But it supports 4."
  763.         else
  764.             voidflags=1
  765.             echo "And it doesn't support 4."
  766.         fi
  767.         fi
  768.     else
  769.         echo "There is no support at all for void."
  770.         voidflags=0
  771.     fi
  772.     fi
  773. esac
  774. dflt="$voidflags";
  775. rp="Your void support flags add up to what? [$dflt]"
  776. $echo $n "$rp $c"
  777. . myread
  778. voidflags="$ans"
  779. $rm -f try.* .out
  780.  
  781. : see how we invoke the C preprocessor
  782. echo " "
  783. echo "Now, how can we feed standard input to your C preprocessor..."
  784. cat <<'EOT' >testcpp.c
  785. #define ABC abc
  786. #define XYZ xyz
  787. ABC.XYZ
  788. EOT
  789. echo 'Maybe "'$cpp'" will work...'
  790. $cpp <testcpp.c >testcpp.out 2>&1
  791. if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  792.     echo "Yup, it does."
  793.     cppstdin="$cpp"
  794.     cppminus='';
  795. else
  796.     echo 'Nope, maybe "'$cpp' -" will work...'
  797.     $cpp - <testcpp.c >testcpp.out 2>&1
  798.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  799.     echo "Yup, it does."
  800.     cppstdin="$cpp"
  801.     cppminus='-';
  802.     else
  803.     echo 'No such luck...maybe "cc -E" will work...'
  804.     cc -E <testcpp.c >testcpp.out 2>&1
  805.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  806.         echo "It works!"
  807.         cppstdin='cc -E'
  808.         cppminus='';
  809.     else
  810.         echo 'Nixed again...maybe "cc -E -" will work...'
  811.         cc -E - <testcpp.c >testcpp.out 2>&1
  812.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  813.         echo "Hooray, it works!  I was beginning to wonder."
  814.         cppstdin='cc -E'
  815.         cppminus='-';
  816.         else
  817.         echo 'Nope...maybe "cc -P" will work...'
  818.         cc -P <testcpp.c >testcpp.out 2>&1
  819.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  820.             echo "Yup, that does."
  821.             cppstdin='cc -P'
  822.             cppminus='';
  823.         else
  824.             echo 'Nope...maybe "cc -P -" will work...'
  825.             cc -P - <testcpp.c >testcpp.out 2>&1
  826.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  827.             echo "Yup, that does."
  828.             cppstdin='cc -P'
  829.             cppminus='-';
  830.             else
  831.             echo 'Hmm...perhaps you already told me...'
  832.             case "$cppstdin" in
  833.             '') ;;
  834.             *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  835.             esac
  836.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  837.                 echo "Hooray, you did!  I was beginning to wonder."
  838.             else
  839.                 echo 'Uh-uh.  Time to get fancy...'
  840.                 echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
  841.                 cppstdin='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
  842.                 cppminus='';
  843.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  844.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  845.                 echo "Eureka!."
  846.                 else
  847.                 dflt=blurfl
  848.                 $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  849.                 rp='Name a C preprocessor:'
  850.                 . myread
  851.                 cppstdin="$ans"
  852.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  853.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  854.                     echo "OK, that will do."
  855.                 else
  856.                     echo "Sorry, I can't get that to work.  Go find one."
  857.                     exit 1
  858.                 fi
  859.                 fi
  860.             fi
  861.             fi
  862.         fi
  863.         fi
  864.     fi
  865.     fi
  866. fi
  867. rm -f testcpp.c testcpp.out
  868.  
  869. : get C preprocessor symbols handy
  870. echo " "
  871. echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
  872. $cat <<EOSS >Cppsym
  873. $startsh
  874. case "\$1" in
  875. -l) list=true
  876.     shift
  877.     ;;
  878. esac
  879. unknown=''
  880. case "\$list\$#" in
  881. 1|2)
  882.     for sym do
  883.     if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  884.         exit 0
  885.     elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  886.         :
  887.     else
  888.         unknown="\$unknown \$sym"
  889.     fi
  890.     done
  891.     set X \$unknown
  892.     shift
  893.     ;;
  894. esac
  895. case \$# in
  896. 0) exit 1;;
  897. esac
  898. echo \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
  899. #ifdef \1\\
  900. exit 0; _ _ _ _\1\\     \1\\
  901. #endif\\
  902. /' >/tmp/Cppsym\$\$
  903. echo exit 1 >>/tmp/Cppsym\$\$
  904. $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  905. case "\$list" in
  906. true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  907. *)
  908.     sh /tmp/Cppsym2\$\$
  909.     status=\$?
  910.     ;;
  911. esac
  912. $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  913. exit \$status
  914. EOSS
  915. chmod +x Cppsym
  916. $eunicefix Cppsym
  917. echo "Your C preprocessor defines the following symbols:"
  918. Cppsym -l $attrlist >Cppsym.true
  919. cat Cppsym.true
  920. rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  921.  
  922. : see how many register declarations we want to use
  923. case "$registers" in
  924. '')
  925.     if Cppsym vax; then
  926.     dflt=6
  927.     elif Cppsym sun mc68000 mc68k m68k; then
  928.     dflt=10
  929.     elif Cppsym pyr; then
  930.     dflt=14
  931.     elif Cppsym ns32000 ns16000; then
  932.     dflt=5
  933.     elif Cppsym $smallmach; then
  934.     dflt=3
  935.     else
  936.     : if you have any other numbers for me, send them in
  937.     dflt=6
  938.     fi
  939.     ;;
  940. *)  dflt=$registers ;;
  941. esac
  942. cat <<EOM
  943.  
  944. Different C compilers on different machines pay attention to different
  945. numbers of register declarations.  About how many register declarations in
  946. EOM
  947. $echo $n "each routine does your C compiler pay attention to? (OK to guess) [$dflt] $c"
  948. rp="# register declarations used? [$dflt]"
  949. . myread
  950. registers=$ans
  951. reg1=''
  952. awk "BEGIN { for (i=1; i<=16; i++) printf \"reg%d=''\n\", i}" </dev/null >.foo
  953. . .foo
  954. awk "BEGIN { for (i=1; i<=$registers; i++) printf \"reg%d=register\n\", i}" \
  955.     </dev/null >.foo
  956. . .foo
  957. rm -f .foo
  958.  
  959. : preserve RCS keywords in files with variable substitution, grrr
  960. Log='$Log'
  961. Header='$Header'
  962.  
  963. : set up shell script to do ~ expansion
  964. cat >filexp <<EOSS
  965. $startsh
  966. : expand filename
  967. case "\$1" in
  968.  ~/*|~)
  969.     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  970.     ;;
  971.  ~*)
  972.     if $test -f /bin/csh; then
  973.     /bin/csh -f -c "glob \$1"
  974.     echo ""
  975.     else
  976.     name=\`$expr x\$1 : '..\([^/]*\)'\`
  977.     dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  978.     if $test ! -d "\$dir"; then
  979.         me=\`basename \$0\`
  980.         echo "\$me: can't locate home directory for: \$name" >&2
  981.         exit 1
  982.     fi
  983.     case "\$1" in
  984.     */*)
  985.         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  986.         ;;
  987.     *)
  988.         echo \$dir
  989.         ;;
  990.     esac
  991.     fi
  992.     ;;
  993. *)
  994.     echo \$1
  995.     ;;
  996. esac
  997. EOSS
  998. chmod +x filexp
  999. $eunicefix filexp
  1000.  
  1001. : determine where public executables go
  1002. case "$bin" in
  1003. '')
  1004.     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  1005.     ;;
  1006. *)  dflt="$bin"
  1007.     ;;
  1008. esac
  1009. cont=true
  1010. while $test "$cont" ; do
  1011.     echo " "
  1012.     rp="Where do you want to put the public executables? [$dflt]"
  1013.     $echo $n "$rp $c"
  1014.     . myread
  1015.     bin="$ans"
  1016.     bin=`filexp $bin`
  1017.     if test -d $bin; then
  1018.     cont=''
  1019.     else
  1020.     dflt=n
  1021.     rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  1022.     $echo $n "$rp $c"
  1023.     . myread
  1024.     dflt=''
  1025.     case "$ans" in
  1026.     y*) cont='';;
  1027.     esac
  1028.     fi
  1029. done
  1030.  
  1031. : determine where manual pages go
  1032. case "$mansrc" in
  1033. '')
  1034.     dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
  1035.     ;;
  1036. *)  dflt="$mansrc"
  1037.     ;;
  1038. esac
  1039. cont=true
  1040. while $test "$cont" ; do
  1041.     echo " "
  1042.     rp="Where do the manual pages (source) go? [$dflt]"
  1043.     $echo $n "$rp $c"
  1044.     . myread
  1045.     mansrc=`filexp "$ans"`
  1046.     if test -d $mansrc; then
  1047.     cont=''
  1048.     else
  1049.     dflt=n
  1050.     rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
  1051.     $echo $n "$rp $c"
  1052.     . myread
  1053.     dflt=''
  1054.     case "$ans" in
  1055.     y*) cont='';;
  1056.     esac
  1057.     fi
  1058. done
  1059. case "$mansrc" in
  1060. *l)
  1061.     manext=l
  1062.     ;;
  1063. *n)
  1064.     manext=n
  1065.     ;;
  1066. *C)
  1067.     manext=C
  1068.     ;;
  1069. *)
  1070.     manext=1
  1071.     ;;
  1072. esac
  1073.  
  1074. : see what memory models we can support
  1075. case "$models" in
  1076. '')
  1077.     if Cppsym pdp11; then
  1078.     dflt='unsplit split'
  1079.     else
  1080.     ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
  1081.     case "$ans" in
  1082.     X) dflt='none';;
  1083.     *)  if $test -d /lib/small || $test -d /usr/lib/small; then
  1084.         dflt='small'
  1085.         else
  1086.         dflt=''
  1087.         fi
  1088.         if $test -d /lib/medium || $test -d /usr/lib/medium; then
  1089.         dflt="$dflt medium"
  1090.         fi
  1091.         if $test -d /lib/large || $test -d /usr/lib/large; then
  1092.         dflt="$dflt large"
  1093.         fi
  1094.         if $test -d /lib/huge || $test -d /usr/lib/huge; then
  1095.         dflt="$dflt huge"
  1096.         fi
  1097.     esac
  1098.     fi
  1099.     ;;
  1100. *)  dflt="$models" ;;
  1101. esac
  1102. $cat <<EOM
  1103.  
  1104. Some systems have different model sizes.  On most systems they are called
  1105. small, medium, large, and huge.  On the PDP11 they are called unsplit and
  1106. split.  If your system doesn't support different memory models, say "none".
  1107. If you wish to force everything to one memory model, say "none" here and
  1108. put the appropriate flags later when it asks you for other cc and ld flags.
  1109. Venix systems may wish to put "none" and let the compiler figure things out.
  1110. (In the following question multiple model names should be space separated.)
  1111.  
  1112. EOM
  1113. rp="Which models are supported? [$dflt]"
  1114. $echo $n "$rp $c"
  1115. . myread
  1116. models="$ans"
  1117.  
  1118. case "$models" in
  1119. none)
  1120.     small=''
  1121.     medium=''
  1122.     large=''
  1123.     huge=''
  1124.     unsplit=''
  1125.     split=''
  1126.     ;;
  1127. *split)
  1128.     case "$split" in
  1129.     '') 
  1130.     if $contains '-i' $mansrc/ld.1 >/dev/null 2>&1 || \
  1131.        $contains '-i' $mansrc/cc.1 >/dev/null 2>&1; then
  1132.         dflt='-i'
  1133.     else
  1134.         dflt='none'
  1135.     fi
  1136.     ;;
  1137.     *) dflt="$split";;
  1138.     esac
  1139.     rp="What flag indicates separate I and D space? [$dflt]"
  1140.     $echo $n "$rp $c"
  1141.     . myread
  1142.     case "$ans" in
  1143.     none) ans='';;
  1144.     esac
  1145.     split="$ans"
  1146.     unsplit=''
  1147.     ;;
  1148. *large*|*small*|*medium*|*huge*)
  1149.     case "$model" in
  1150.     *large*)
  1151.     case "$large" in
  1152.     '') dflt='-Ml';;
  1153.     *) dflt="$large";;
  1154.     esac
  1155.     rp="What flag indicates large model? [$dflt]"
  1156.     $echo $n "$rp $c"
  1157.     . myread
  1158.     case "$ans" in
  1159.     none) ans='';
  1160.     esac
  1161.     large="$ans"
  1162.     ;;
  1163.     *) large='';;
  1164.     esac
  1165.     case "$model" in
  1166.     *huge*)
  1167.     case "$huge" in
  1168.     '') dflt='-Mh';;
  1169.     *) dflt="$huge";;
  1170.     esac
  1171.     rp="What flag indicates huge model? [$dflt]"
  1172.     $echo $n "$rp $c"
  1173.     . myread
  1174.     case "$ans" in
  1175.     none) ans='';
  1176.     esac
  1177.     huge="$ans"
  1178.     ;;
  1179.     *) huge="$large";;
  1180.     esac
  1181.     case "$model" in
  1182.     *medium*)
  1183.     case "$medium" in
  1184.     '') dflt='-Mm';;
  1185.     *) dflt="$medium";;
  1186.     esac
  1187.     rp="What flag indicates medium model? [$dflt]"
  1188.     $echo $n "$rp $c"
  1189.     . myread
  1190.     case "$ans" in
  1191.     none) ans='';
  1192.     esac
  1193.     medium="$ans"
  1194.     ;;
  1195.     *) medium="$large";;
  1196.     esac
  1197.     case "$model" in
  1198.     *small*)
  1199.     case "$small" in
  1200.     '') dflt='none';;
  1201.     *) dflt="$small";;
  1202.     esac
  1203.     rp="What flag indicates small model? [$dflt]"
  1204.     $echo $n "$rp $c"
  1205.     . myread
  1206.     case "$ans" in
  1207.     none) ans='';
  1208.     esac
  1209.     small="$ans"
  1210.     ;;
  1211.     *) small='';;
  1212.     esac
  1213.     ;;
  1214. *)
  1215.     echo "Unrecognized memory models--you may have to edit Makefile.SH"
  1216.     ;;
  1217. esac
  1218.  
  1219. case "$ccflags" in
  1220. '') dflt='none';;
  1221. *) dflt="$ccflags";;
  1222. esac
  1223. echo " "
  1224. rp="Any additional cc flags? [$dflt]"
  1225. $echo $n "$rp $c"
  1226. . myread
  1227. case "$ans" in
  1228. none) ans='';
  1229. esac
  1230. ccflags="$ans"
  1231.  
  1232. case "$ldflags" in
  1233. '') if venix; then
  1234.     dflt='-i -z'
  1235.     elif xenix; then
  1236.     if test -f /usr/include/dirent.h; then
  1237.         dflt='-ldir -lx'
  1238.     else
  1239.         dflt='-lx'
  1240.     fi
  1241.     else
  1242.     dflt='none'
  1243.     fi
  1244.     ;;
  1245. *) dflt="$ldflags";;
  1246. esac
  1247. echo " "
  1248. rp="Any additional ld flags? [$dflt]"
  1249. $echo $n "$rp $c"
  1250. . myread
  1251. case "$ans" in
  1252. none) ans='';
  1253. esac
  1254. ldflags="$ans"
  1255.  
  1256. : see if we need a special compiler
  1257. echo " "
  1258. if usg; then
  1259.     case "$cc" in
  1260.     '')
  1261.     case "$Mcc" in
  1262.     /*) dflt='Mcc'
  1263.         ;;
  1264.     *)
  1265.         case "$large" in
  1266.         -M*)
  1267.         dflt='cc'
  1268.         ;;
  1269.         *)
  1270.         if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1271.             dflt='cc -M'
  1272.         else
  1273.             dflt='cc'
  1274.         fi
  1275.         ;;
  1276.         esac
  1277.         ;;
  1278.     esac
  1279.     ;;
  1280.     *)  dflt="$cc";;
  1281.     esac
  1282.     $cat <<'EOM'
  1283.  
  1284. On some systems the default C compiler will not resolve multiple global
  1285. references that happen to have the same name.  On some such systems the
  1286. "Mcc" command may be used to force these to be resolved.  On other systems
  1287. a "cc -M" command is required.  (Note that the -M flag on other systems
  1288. indicates a memory model to use!)  What command will force resolution on
  1289. EOM
  1290.     $echo $n "this system? [$dflt] $c"
  1291.     rp="Command to resolve multiple refs? [$dflt]"
  1292.     . myread
  1293.     cc="$ans"
  1294. else
  1295.     echo "Not a USG system--assuming cc can resolve multiple definitions."
  1296.     cc=cc
  1297. fi
  1298.  
  1299. echo " "
  1300. echo "End of configuration questions."
  1301. echo " "
  1302.  
  1303. : create config.sh file
  1304. echo " "
  1305. if test -d ../UU; then
  1306.     cd ..
  1307. fi
  1308. echo "Creating config.sh..."
  1309. $spitshell <<EOT >config.sh
  1310. $startsh
  1311. # config.sh
  1312. # This file was produced by running the Configure script.
  1313.  
  1314. d_eunice='$d_eunice'
  1315. eunicefix='$eunicefix'
  1316. define='$define'
  1317. loclist='$loclist'
  1318. expr='$expr'
  1319. sed='$sed'
  1320. echo='$echo'
  1321. cat='$cat'
  1322. rm='$rm'
  1323. mv='$mv'
  1324. cp='$cp'
  1325. tail='$tail'
  1326. tr='$tr'
  1327. mkdir='$mkdir'
  1328. sort='$sort'
  1329. uniq='$uniq'
  1330. grep='$grep'
  1331. trylist='$trylist'
  1332. test='$test'
  1333. inews='$inews'
  1334. egrep='$egrep'
  1335. more='$more'
  1336. pg='$pg'
  1337. Mcc='$Mcc'
  1338. vi='$vi'
  1339. mailx='$mailx'
  1340. mail='$mail'
  1341. cpp='$cpp'
  1342. Log='$Log'
  1343. Header='$Header'
  1344. bin='$bin'
  1345. cc='$cc'
  1346. contains='$contains'
  1347. cppstdin='$cppstdin'
  1348. cppminus='$cppminus'
  1349. d_charsprf='$d_charsprf'
  1350. d_flexfnam='$d_flexfnam'
  1351. d_index='$d_index'
  1352. d_voidsig='$d_voidsig'
  1353. d_dirheader='$d_dirheader'
  1354. d_unistd='$d_unistd'
  1355. libc='$libc'
  1356. mansrc='$mansrc'
  1357. manext='$manext'
  1358. models='$models'
  1359. split='$split'
  1360. small='$small'
  1361. medium='$medium'
  1362. large='$large'
  1363. huge='$huge'
  1364. ccflags='$ccflags'
  1365. ldflags='$ldflags'
  1366. n='$n'
  1367. c='$c'
  1368. package='$package'
  1369. registers='$registers'
  1370. reg1='$reg1'
  1371. reg2='$reg2'
  1372. reg3='$reg3'
  1373. reg4='$reg4'
  1374. reg5='$reg5'
  1375. reg6='$reg6'
  1376. reg7='$reg7'
  1377. reg8='$reg8'
  1378. reg9='$reg9'
  1379. reg10='$reg10'
  1380. reg11='$reg11'
  1381. reg12='$reg12'
  1382. reg13='$reg13'
  1383. reg14='$reg14'
  1384. reg15='$reg15'
  1385. reg16='$reg16'
  1386. spitshell='$spitshell'
  1387. shsharp='$shsharp'
  1388. sharpbang='$sharpbang'
  1389. startsh='$startsh'
  1390. voidflags='$voidflags'
  1391. defvoidused='$defvoidused'
  1392. CONFIG=true
  1393. EOT
  1394.  
  1395. CONFIG=true
  1396.  
  1397. echo " "
  1398. dflt=''
  1399. fastread=''
  1400. echo "If you didn't make any mistakes, then just type a carriage return here."
  1401. rp="If you need to edit config.sh, do it as a shell escape here:"
  1402. $echo $n "$rp $c"
  1403. . UU/myread
  1404. case "$ans" in
  1405. '') ;;
  1406. *) : in case they cannot read
  1407.     eval $ans;;
  1408. esac
  1409. . ./config.sh
  1410.  
  1411. echo " "
  1412. echo "Doing variable substitutions on .SH files..."
  1413. set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  1414. shift
  1415. case $# in
  1416. 0) set x *.SH; shift;;
  1417. esac
  1418. if test ! -f $1; then
  1419.     shift
  1420. fi
  1421. for file in $*; do
  1422.     case "$file" in
  1423.     */*)
  1424.     dir=`$expr X$file : 'X\(.*\)/'`
  1425.     file=`$expr X$file : 'X.*/\(.*\)'`
  1426.     (cd $dir && . $file)
  1427.     ;;
  1428.     *)
  1429.     . $file
  1430.     ;;
  1431.     esac
  1432. done
  1433. if test -f config.h.SH; then
  1434.     if test ! -f config.h; then
  1435.     : oops, they left it out of MANIFEST, probably, so do it anyway.
  1436.     . config.h.SH
  1437.     fi
  1438. fi
  1439.  
  1440. if $contains '^depend:' Makefile >/dev/null 2>&1; then
  1441.     dflt=n
  1442.     $cat <<EOM
  1443.  
  1444. Now you need to generate make dependencies by running "make depend".
  1445. You might prefer to run it in background: "make depend > makedepend.out &"
  1446. It can take a while, so you might not want to run it right now.
  1447.  
  1448. EOM
  1449.     rp="Run make depend now? [$dflt]"
  1450.     $echo $n "$rp $c"
  1451.     . UU/myread
  1452.     case "$ans" in
  1453.     y*) make depend
  1454.     echo "Now you must run a make."
  1455.     ;;
  1456.     *)  echo "You must run 'make depend' then 'make'."
  1457.     ;;
  1458.     esac
  1459. elif test -f Makefile; then
  1460.     echo " "
  1461.     echo "Now you must run a make."
  1462. else
  1463.     echo "Done."
  1464. fi
  1465.  
  1466. $rm -f kit*isdone
  1467. : the following is currently useless
  1468. cd UU && $rm -f $rmlist
  1469. : since this removes it all anyway
  1470. cd .. && $rm -rf UU
  1471. : end of Configure
  1472.